import request from "@/assets/js/request";
import util from "@/assets/js/public";
import { getToken } from '@/assets/js/auth';
import Vue from "vue";

//获取二级栏目详细数据
export function findCategoryInfo(params){
    return request({
        url:process.env.VUE_APP_URL + '/action/openapi/bps/common/transmit/us$category$api$findCategoryInfo?source=MOBILE',
        contentType:'application/json;charset=UTF-8',
        data:{
            "access_token":getToken(),
            "appCode":"yglt",
            "currentUserCode":util.encrypt(params.userName),
            "versionName":"2.7.92",
            "source":'MOBILE',
            "noAction":'1',  
            "kv":{
                "currentUserCode":util.encrypt(params.userName),
                "source":'MOBILE',
                "isFlag":'1',
                "parentId":params.parentId
            },
            // "jsonName":'appDecision',
            // "appDecision":params.fromdetaildata
        }
    })
}
//查询二级栏目下话题
export function findAllList(params){
    return request({
        url:process.env.VUE_APP_URL + '/action/openapi/bps/common/transmit/us$topic$api$findAllList?source=MOBILE',
        contentType:'application/json;charset=UTF-8',
        data:{
            "access_token":getToken(),
            "appCode":"yglt",
            "currentUserCode":util.encrypt(params.userName),
            "versionName":"2.7.92",
            "source":'MOBILE',
            "noAction":'1',  
            "kv":{
                "currentUserCode":util.encrypt(params.userName),
                "source":'MOBILE',
                "isFlag":'1',
                "parentCategoryId":params.parentCategoryId,
                "categoryId":params.categoryId
            },
            // "jsonName":'appDecision',
            // "appDecision":params.fromdetaildata
        }
    })
}
//获取当前账户信息
export function findCurrentAccount(params){
    return request({
        url:process.env.VUE_APP_URL + '/action/openapi/bps/common/transmit/us$account$api$findCurrentAccount?source=MOBILE',
        contentType:'application/json;charset=UTF-8',
        data:{
            "access_token":getToken(),
            "appCode":"yglt",
            "currentUserCode":util.encrypt(params.userName),
            "versionName":"2.7.92",
            "source":'MOBILE',
            "noAction":'1',  
            "kv":{
                "currentUserCode":util.encrypt(params.userName),
                "source":'MOBILE',
                "isFlag":'1',
            },
            // "jsonName":'appDecision',
            // "appDecision":params.fromdetaildata
        }
    })
}

//禁言用户
export function forbiddenByName(params){
  return request({
      url:process.env.VUE_APP_URL + '/action/openapi/bps/common/transmit/us$account$api$forbiddenByName?source=MOBILE',
      contentType:'application/json;charset=UTF-8',
      data:{
          "access_token":getToken(),
          "appCode":"yglt",
          "currentUserCode":util.encrypt(params.userName),
          "versionName":"2.7.92",
          "source":'MOBILE',
          "noAction":'1',  
          "kv":{
              "currentUserCode":util.encrypt(params.userName),
              "source":'MOBILE',
              "isFlag":'1',
          },
          "jsonName":'appDecision',
          "appDecision":{
            "name":params.name,
            "prohibitionTime":params.prohibitionTime
          }
      }
  })
}